package com.example.trackcircuitdiagnosis.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 
 * @TableName fault_type
 */
@TableName(value ="fault_type")
@Data
public class FaultTypeEntity implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 
     */
    @TableField(value = "name")
    private String name;

    /**
     * 
     */
    @TableField(value = "nameE")
    private String nameE;

    /**
     * 
     */
    @TableField(value = "facilityId")
    private Integer facilityId;

    /**
     * 
     */
    @TableField(value = "repairAdvice")
    private String repairAdvice;

    /**
     * 
     */
    @TableField(value = "dangerLevel")
    private String dangerLevel;

    // 危险等级 可选值 报警 预警
    private String result;
    //extent
    private Integer modelId;
    private Integer areaTypeId;
    private String modelName;
    private String areaTypeName;
    private String facilityName;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        FaultTypeEntity other = (FaultTypeEntity) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getNameE() == null ? other.getNameE() == null : this.getNameE().equals(other.getNameE()))
            && (this.getFacilityId() == null ? other.getFacilityId() == null : this.getFacilityId().equals(other.getFacilityId()))
            && (this.getRepairAdvice() == null ? other.getRepairAdvice() == null : this.getRepairAdvice().equals(other.getRepairAdvice()))
            && (this.getDangerLevel() == null ? other.getDangerLevel() == null : this.getDangerLevel().equals(other.getDangerLevel()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getNameE() == null) ? 0 : getNameE().hashCode());
        result = prime * result + ((getFacilityId() == null) ? 0 : getFacilityId().hashCode());
        result = prime * result + ((getRepairAdvice() == null) ? 0 : getRepairAdvice().hashCode());
        result = prime * result + ((getDangerLevel() == null) ? 0 : getDangerLevel().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", nameE=").append(nameE);
        sb.append(", facilityId=").append(facilityId);
        sb.append(", repairAdvice=").append(repairAdvice);
        sb.append(", dangerLevel=").append(dangerLevel);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}